package com.guigu.basedservice.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.guigu.basedservice.dto.CarSeriesInfoDto;
import com.guigu.basedservice.entity.BaseCarFactory;
import com.guigu.basedservice.mapper.CarSeriesInfoDtoMapper;
import com.guigu.basedservice.service.CarSeriesInfoService;
import com.guigu.basedservice.vo.BaseCarFactoryVo;
import com.guigu.basedservice.vo.CarSeriesInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * @author heyuhang
 * @create 2024/9/19
 */
@Service
public class CarSeriesInfoServiceImpl implements CarSeriesInfoService {

    @Autowired(required = false)
    private CarSeriesInfoDtoMapper carSeriesInfoMapper;

    /**
     * @PathVariable

     * @param currentPage
     * @param pageSize
     * @param vo
     * @return
     */
    @Override
    public PageInfo<CarSeriesInfoDto> getCarSeriesInfo(
            Integer currentPage,
            Integer pageSize,
            CarSeriesInfoVo vo
    ) {
        PageHelper.startPage(currentPage,pageSize);
        List<CarSeriesInfoDto> carSeriesInfo = carSeriesInfoMapper.getCarSeriesInfo(vo);
        PageInfo<CarSeriesInfoDto> pageInfo=new PageInfo<>(carSeriesInfo);
        return pageInfo;
    }
}
